﻿<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<common:LayoutAwarePage
    x:Class="Tiles.SendBadge"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Tiles"
    xmlns:common="using:SDKTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid x:Name="Input" Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,0,0,10">
                    This scenario demonstrates how to send a badge notification.
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">
                    Badge notifications update your application's tile with a number or Windows provided glyph. Badges will be displayed on all tile sizes, including the small (square70x70) tile size.
                </TextBlock>

                <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="SemiBold"  Margin="0,20,0,0">
                    Choose if you want to display a number or a glyph:
                </TextBlock>
                <StackPanel HorizontalAlignment="Left" Orientation="Vertical">
                    <ComboBox x:Name="NumberOrGlyph" SelectionChanged="NumberOrGlyph_SelectionChanged">
                        <ComboBoxItem x:Name="Number">Number</ComboBoxItem>
                        <ComboBoxItem x:Name="Glyph">Glyph</ComboBoxItem>
                    </ComboBox>
                    <StackPanel x:Name="NumberPanel">
                        <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,20,0,0" FontWeight="SemiBold">
                            Enter a number between 1 and 99. Any number above 99 will be displayed on the tile as 99+:
                        </TextBlock>
                        <TextBox x:Name="NumberInput" Text="1" />
                    </StackPanel>
                    <StackPanel x:Name="GlyphPanel" Visibility="Collapsed">
                        <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,20,0,0" FontWeight="SemiBold">
                            Now choose the glyph you want to display:
                        </TextBlock>
                        <ComboBox x:Name="GlyphList">
                            <ComboBoxItem x:Name="none">none</ComboBoxItem>
                            <ComboBoxItem x:Name="activity">activity</ComboBoxItem>
                            <ComboBoxItem x:Name="alert">alert</ComboBoxItem>
                            <ComboBoxItem x:Name="available">available</ComboBoxItem>
                            <ComboBoxItem x:Name="away">away</ComboBoxItem>
                            <ComboBoxItem x:Name="busy">busy</ComboBoxItem>
                            <ComboBoxItem x:Name="newMessage">newMessage</ComboBoxItem>
                            <ComboBoxItem x:Name="paused">paused</ComboBoxItem>
                            <ComboBoxItem x:Name="playing">playing</ComboBoxItem>
                            <ComboBoxItem x:Name="unavailable">unavailable</ComboBoxItem>
                            <ComboBoxItem x:Name="error">error</ComboBoxItem>
                            <ComboBoxItem x:Name="attention">attention</ComboBoxItem>
                            <ComboBoxItem x:Name="alarm">alarm</ComboBoxItem>
                        </ComboBox>
                    </StackPanel>
                </StackPanel>

                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,20,0,0">
                    Send using the Notifications Extensions Library:
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" >
                    For the first example, we use the Notifications Extensions Library to build the notification payload.
                </TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Button x:Name="UpdateBadge" Content="Send badge notification" Click="UpdateBadge_Click" />
                    <Button x:Name="ClearBadge" Content="Clear badge" Click="ClearBadge_Click" />
                </StackPanel>

                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,20,0,0">
                    Send by constructing your own payload:
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">
                    Since notifications are simply XML, you can create them in many different ways. For example, here we create notifications by constructing strings.
                </TextBlock>
                <StackPanel>
                    <Button x:Name="UpdateBadgeWithStringManipulation" Content="Send badge notification created with strings" Click="UpdateBadge_Click" />
                </StackPanel>
            </StackPanel>
        </Grid>

        <Grid x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1">
            <TextBlock x:Name="OutputTextBlock" Text="" TextWrapping="Wrap"  Style="{StaticResource BasicTextStyle}" IsTextSelectionEnabled="True"/>
        </Grid>

        <!-- Add Storyboards to the visual states below as necessary for supporting the various layouts -->
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="DefaultLayout"/>
                <VisualState x:Name="Below768Layout"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>

</common:LayoutAwarePage>
